<?php

class Subsidio extends AppModel {

    public $label = 'Subsidios';
    public $tablePrefix = 'sub_';
    public $useTable = 'subsidios';
    public $displayField = 'numero';
    public $recursive = -1;
    public $hasAndBelongsToMany = array(
        'Ruta' => array(
            'className' => 'Ruta',
            'joinTable' => 'sub_subsidios_rutas',
            'foreignKey' => 'subsidio_id',
            'associationForeignKey' => 'ruta_id',
            'unique' => true
        )
    );
    public $validate = array(
        'en_ruta' => array(
            'required' => array(
                'rule' => array('notEmpty'),
                'message' => 'Debe indicar si deja al subsidio en ruta'
            )
        ),
        'tmp_columna' => array(
            'required' => array(
                'rule' => array('notEmpty'),
                'message' => 'Debe indicar la columna que contiene los expedientes'
            )
        )
    );

}